//
//  JiaoYiFromView.m
//  DBAChain
//
//  Created by Evan on 2018/9/6.
//  Copyright © 2018 Evan. All rights reserved.
//

#import "JiaoYiFromView.h"
#import "CommonData.h"

@implementation JiaoYiFromView

-(void)initUI{
    self.labelGET.textColor = LCFromRGB(51, 51, 51);
    self.labelGETName.textColor = LCFromRGB(51, 51, 51);
    
    [self.txtMRNumber addTarget:self action:@selector(txtMRXEChange:) forControlEvents:UIControlEventEditingChanged];
    [self.txtMRNumber addTarget:self action:@selector(txtMRNumberChange:) forControlEvents:UIControlEventEditingChanged];
}

-(void)txtMRXEChange:(UITextField*)sender{
    [self JiSuanCount];
}

-(void)txtMRNumberChange:(UITextField*)sender{
    [self JiSuanCount];
}

-(void)JiSuanCount{
    NSInteger sNumber = [self.txtMRNumber.text integerValue];
    CGFloat sPrice = [self.txtMRPrice.text floatValue];
    sNumber = sNumber <= 0 ? 0:sNumber;
    sPrice = sPrice <= 0 ? 0 : sPrice;
    CGFloat count = sNumber * sPrice;
    
    self.labelHeJi.text = [NSString stringWithFormat:@"%.2f",count];
}


@end
